package com.wmyg.antifake.utils;

import com.wmyg.antifake.bean.Picture;
import com.wmyg.antifake.bean.PictureConvert;

import java.util.ArrayList;
import java.util.List;

public class PicConvertUtils {

    /**
     * 得到转化后的图片信息 存的对象
     * @param list
     * @return
     */
    public static PictureConvert getPictureConvert(List<Picture> list){
        PictureConvert picConvert=new PictureConvert();
        List<Picture> logoList=new ArrayList<>();
        List<Picture> certList=new ArrayList<>();
        List<Picture> picList=new ArrayList<>();

        for(Picture picture : list){
            switch (picture.getPicType()){
                case 1:
                    logoList.add(picture);
                    break;
                case 2:
                    certList.add(picture);
                    break;
                case 3:
                    picList.add(picture);
                    break;
            }

        }
        picConvert.setLogo(logoList);
        picConvert.setCert(certList);
        picConvert.setPic(picList);
        return picConvert;
    }

    /**
     * 得到转化后的图片信息 存的url
     * @param list
     * @return
     */
    /*public static PictureConvert getPictureConvertUrl(List<Picture> list){
        PictureConvert picConvert=new PictureConvert();
        List<String> logoList=new ArrayList<>();
        List<String> certList=new ArrayList<>();
        List<String> picList=new ArrayList<>();

        for(Picture picture : list){
            switch (picture.getPicType()){
                case 1:
                    logoList.add(picture.getPicUrl());
                    break;
                case 2:
                    certList.add(picture.getPicUrl());
                    break;
                case 3:
                    picList.add(picture.getPicUrl());
                    break;
            }

        }
        picConvert.setLogoUrlList(logoList);
        picConvert.setCertUrlList(certList);
        picConvert.setPicUrlList(picList);
        return picConvert;
    }*/
}
